/*  1:   */ package com.atomikos.icatch.jta;
/*  2:   */ 
/*  3:   */ import com.atomikos.datasource.xa.AcceptAllXATransactionalResource;
/*  4:   */ import com.atomikos.icatch.SysException;
/*  5:   */ import com.atomikos.icatch.config.TSInitInfo;
/*  6:   */ import com.atomikos.icatch.config.imp.AbstractUserTransactionService;
/*  7:   */ import com.atomikos.icatch.system.Configuration;
/*  8:   */ import java.util.Enumeration;
/*  9:   */ import javax.transaction.TransactionManager;
/* 10:   */ 
/* 11:   */ public abstract class AbstractJtaUserTransactionService
/* 12:   */   extends AbstractUserTransactionService
/* 13:   */ {
/* 14:   */   public void init(TSInitInfo info)
/* 15:   */     throws SysException
/* 16:   */   {
/* 17:50 */     super.init(info);
/* 18:51 */     String autoRegisterProperty = getTrimmedProperty("com.atomikos.icatch.automatic_resource_registration", info.getProperties());
/* 19:   */     
/* 20:   */ 
/* 21:54 */     boolean autoRegister = "true".equals(autoRegisterProperty);
/* 22:55 */     if ((Configuration.getResources().hasMoreElements()) && (!autoRegister))
/* 23:   */     {
/* 24:56 */       AcceptAllXATransactionalResource defaultRes = new AcceptAllXATransactionalResource("com.atomikos.icatch.DefaultResource");
/* 25:   */       
/* 26:58 */       Configuration.addResource(defaultRes);
/* 27:   */     }
/* 28:   */   }
/* 29:   */   
/* 30:   */   public void shutdown(boolean force)
/* 31:   */     throws IllegalStateException
/* 32:   */   {
/* 33:65 */     super.shutdown(force);
/* 34:66 */     TransactionManagerImp.installTransactionManager(null, false);
/* 35:67 */     UserTransactionServerImp.getSingleton().shutdown();
/* 36:   */   }
/* 37:   */   
/* 38:   */   public TransactionManager getTransactionManager()
/* 39:   */   {
/* 40:76 */     return TransactionManagerImp.getTransactionManager();
/* 41:   */   }
/* 42:   */ }


/* Location:           C:\myfile\mysoft\apache-maven-3.5.0-bin\apache-maven-3.5.0\myrep\com\atomikos\transactions-jta\3.7.0\transactions-jta-3.7.0.jar
 * Qualified Name:     com.atomikos.icatch.jta.AbstractJtaUserTransactionService
 * JD-Core Version:    0.7.0.1
 */